home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / pcboard / iemsi120.zip / LOGON.PPS < prev    next >
Text File  |  1996-11-10  |  6KB  |  187 lines

  1. ;-----------------------------------------------------------PowerPPL v2.1----
  2. ; File           : LOGON.PPS
  3. ; Original by    : PAUL MILLER on 10/17/1996 at 19:37:20
  4. ; Last update by : PAUL MILLER on 10/19/1996 at 11:12:06
  5. ;----------------------------------------------------------------------------
  6. ;TAB_SETTING=2
  7. ;VERSION=1.00
  8.  
  9.  
  10.  
  11. ; ***************************************************************************
  12. ; *** NOTE!  This source code is NOT commented!  (under my standards)     ***
  13. ; ***************************************************************************
  14.  
  15.  
  16.  
  17. ; this file is an example logon prompt (#259 replacement) for use with
  18. ; IEMSI Auto-Logon v1.00
  19.  
  20. ; adjusts user settings to what is specified in ICI packet
  21. Declare Procedure Settings()
  22.  
  23. Begin
  24.  
  25. ; declare variables
  26. BigStr        Client_Packet                        ; entire EMSI_ICI data packet
  27. String        ICI_Name                                ; name of client (case insensitive)
  28. String        ICI_Alias                                ; name/alias of client (case insensitive)
  29. String        ICI_Location                        ; geographical location of client
  30. String        ICI_Data#                                ; unformatted, full data telephone number
  31. String        ICI_Voice#                            ; unformatted, full voice telephone number
  32. String        ICI_Password                        ; client password (case insensitive)
  33. String        ICI_Birthdate                        ; hexadecimal of birth date (UNIX)
  34. String        ICI_CrtDef                            ; requested terminal emulation protocol
  35. String        ICI_Protocol                        ; preferred file transfer protocol
  36. String        ICI_Capabilities                ; capabilities of client's software
  37. String        ICI_Requests                        ; client system requests - NEWS, MAIL,
  38.                                                                     ; FILE, HOT, CLR, HUSH, MORE, FSED, XPRS
  39. String        ICI_Software                        ; name, version, serial number of software
  40. String        ICI_XLatTabl                        ; character translation server:client
  41.  
  42. Integer        UserNum                                    ; user/record number of user name
  43. Byte            x                                                ; general index/channel variable
  44.  
  45. ; open IEMSI.(node) information file
  46. x = FNext()
  47. FOpen x, "IEMSI."+ToString(PCBNode()), O_RD, S_DN
  48.  
  49. ; if error openning file/does not exist; proceed with regular logon - IEMSI
  50. ; file will NOT exist if the user does not support IEMSI
  51. If (FErr(x)) Then
  52.     Print ReadLine(PPEPath()+"PRMT259"+LangExt(), 1)
  53.     End
  54. EndIf
  55.  
  56. ; read IEMSI information file as default file input channel
  57. FDefIn x
  58.  
  59.     FDGet Client_Packet                            ; entire EMSI_ICI data packet
  60.     FDGet ICI_Name                                    ; name of client (case insensitive)
  61.     FDGet ICI_Alias                                    ; name/alias of client (case insensitive)
  62.     FDGet ICI_Location                            ; geographical location of client
  63.     FDGet ICI_Data#                                    ; unformatted, full data telephone number
  64.     FDGet ICI_Voice#                                ; unformatted, full voice telephone number
  65.     FDGet ICI_Password                            ; client password (case insensitive)
  66.     FDGet ICI_Birthdate                            ; hexadecimal of birth date (UNIX)
  67.     FDGet ICI_CrtDef                                ; requested terminal emulation protocol
  68.     FDGet ICI_Protocol                            ; preferred file transfer protocol
  69.     FDGet ICI_Capabilities                    ; capabilities of client's software
  70.     FDGet ICI_Requests                            ; client system requests - NEWS, MAIL,
  71.                                                                     ; FILE, HOT, CLR, HUSH, MORE, FSED, XPRS
  72.     FDGet ICI_Software                            ; name, version, serial number of software
  73.     FDGet ICI_XLatTabl                            ; character translation server:client
  74.  
  75. FClose x
  76.  
  77. ; convert strings to upper case for case insensitive matches
  78. ICI_Name = Upper(ICI_Name)
  79. ICI_Password = Upper(ICI_Password)
  80. ICI_Location = Upper(ICI_Location)
  81. ICI_Requests = Upper(ICI_Requests)
  82. ICI_Protocol = Upper(ICI_Protocol)
  83.  
  84. ; find user record number
  85. UserNum = U_RecNum(Upper(ICI_Name))
  86.  
  87. ; if user name does exist
  88. If (UserNum >= 0) Then
  89.  
  90.     ; get user information
  91.     GetAltUser UserNum
  92.  
  93.     ; matching information between user data base & IEMSI
  94.     If (U_PWD = ICI_Password & U_CITY = ICI_Location) Then
  95.         Settings()
  96.         PutAltUser
  97.         KeyFlush
  98.         KbdStuff ICI_Name+";"+ICI_Password
  99.  
  100.     ; locations do not match, prompt for correct one
  101.     ElseIf (U_PWD = ICI_Password)
  102.         PrintLn "@X0ETwo different addresses reported:"
  103.         PrintLn "@X0F  1 = ",ICI_Location
  104.         PrintLn "  2 = ",U_CITY
  105.         NewLine
  106.         InputStr "Which one is correct (Enter)="+ICI_Location, x, 14, 1, "12", NEWLINE
  107.         NewLine
  108.         Select Case x
  109.             Case 2
  110.                 ; use user location
  111.                 PrintLn "@X0APlease correct this [IEMSI] information in your terminal program."
  112.             Case Else
  113.                 ; use IEMSI location
  114.                 U_CITY = ICI_Location
  115.                 PrintLn "@X0ALocation corrected."
  116.         End Select
  117.         Settings()
  118.         PutAltUser
  119.         KeyFlush
  120.         KbdStuff ICI_Name+";"+ICI_Password
  121.  
  122.     ; invalid password
  123.     Else
  124.         KeyFlush
  125.         KbdStuff ICI_Name
  126.  
  127.     EndIf
  128. Else
  129.  
  130.     KeyFlush
  131.     KbdStuff ICI_Name
  132.  
  133. EndIf
  134.  
  135. End
  136.  
  137. Procedure Settings()
  138.     String        str
  139.  
  140.     ; if user does supports/specifies this string, process it
  141.     If (ICI_Requests <> "") Then
  142.  
  143.         ; clear screen setting
  144.         If (InStr(ICI_Requests, "CLR")) Then
  145.             U_CLS = TRUE
  146.         Else
  147.             U_CLS = FALSE
  148.         EndIf
  149.         ; full screen editor setting
  150.         If (InStr(ICI_Requests, "FSED")) Then
  151.             U_FSE = TRUE
  152.             U_FSEP = FALSE
  153.         Else
  154.             U_FSE = FALSE
  155.             U_FSEP = TRUE
  156.         EndIf
  157.  
  158.     EndIf
  159.  
  160.     ; if user does supports/specifies this string, process it
  161.     If (ICI_Protocol <> "") Then
  162.  
  163.         ; protocol selection
  164.         If (InStr(ICI_Protocol, "DZA")) Then
  165.             U_TRANS = "Z"
  166.         ElseIf (InStr(ICI_Protocol, "ZAP"))
  167.             U_TRANS = "Z"
  168.         ElseIf (InStr(ICI_Protocol, "ZMO"))
  169.             U_TRANS = "Z"
  170.         ElseIf (InStr(ICI_Protocol, "SLK"))
  171.             U_TRANS = "S"
  172.         ElseIf (InStr(ICI_Protocol, "KER"))
  173.             U_TRANS = "K"
  174.         EndIf
  175.  
  176.     EndIf
  177.  
  178.     ; if user does supports/specifies this string, process it
  179.     If (ICI_CrtDef <> "") Then
  180.  
  181.         ; page length
  182.         str = Right(ICI_CrtDef, Len(ICI_CrtDef)-InStr(ICI_CrtDef, ","))
  183.         x = Left(str, InStr(str, ",")-1)
  184.     EndIf
  185.  
  186. EndProc
  187.